Microsoft DirectX 8.1 (C++)

Critical Sections

To make deadlocks easier to track, include assertions that determine whether the calling code owns a given critical section. The CritCheckIn and CritCheckOut functions indicate whether the calling thread owns a critical section. Typically, you would call these functions from inside an assert macro.

You can also use the DbgLockTrace function to trace when critical sections are held or released.